const { url } = require('koa-router')
const mock = require('mockjs')
const random = mock.Random


module.exports = [
  //登录
  {
    url:'/user/login',
    method:'post',
    response:()=>{
      return{
        errno:0,
        data:{
          token:random.word(20)
        }
      }
    }
  },
  //注册
  {
    url:'/user/register',
    method:'post',
    response:(data)=>{
      console.log('register',data)
      return{
        errno:0,
        data:{}
      }
    }
  },
  //获取用户信息
  {
    url:'/user/info',
    method:'get',
    response:(data)=>{
      return {
        errno:0,
        data:{
          username:random.name(),
          nickname:random.cname(),
      }
    }
  }
 }
]